\hypertarget{classdev_1_1base_1_1_thread}{}\section{dev\+:\+:base\+:\+:Thread Class Reference}
\label{classdev_1_1base_1_1_thread}\index{dev\+::base\+::\+Thread@{dev\+::base\+::\+Thread}}


{\ttfamily \#include $<$Thread.\+hpp$>$}

Inheritance diagram for dev\+:\+:base\+:\+:Thread\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classdev_1_1base_1_1_thread}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classdev_1_1base_1_1_thread_a9d53e9baeca3f44ab10df09995858f7a}{}enum {\bfseries Status} \{ {\bfseries N\+O\+T\+R\+E\+A\+D\+Y} = 1, 
{\bfseries R\+E\+A\+D\+Y}, 
{\bfseries R\+U\+N\+N\+I\+N\+G}, 
{\bfseries E\+X\+I\+T}
 \}\label{classdev_1_1base_1_1_thread_a9d53e9baeca3f44ab10df09995858f7a}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classdev_1_1base_1_1_thread_aa1ff0068d8e7ab1c8522827b89937611}{}void \hyperlink{classdev_1_1base_1_1_thread_aa1ff0068d8e7ab1c8522827b89937611}{start} (void)\label{classdev_1_1base_1_1_thread_aa1ff0068d8e7ab1c8522827b89937611}

\begin{DoxyCompactList}\small\item\em 启动线程，失败会抛出标准异常 \end{DoxyCompactList}\item 
\hypertarget{classdev_1_1base_1_1_thread_a127b951ac3d37df05921ff084d496a20}{}virtual void \hyperlink{classdev_1_1base_1_1_thread_a127b951ac3d37df05921ff084d496a20}{stop} (void)=0\label{classdev_1_1base_1_1_thread_a127b951ac3d37df05921ff084d496a20}

\begin{DoxyCompactList}\small\item\em 停止线程 \end{DoxyCompactList}\item 
\hypertarget{classdev_1_1base_1_1_thread_ac93bfd511cae069840ec1a3fee205c9c}{}virtual void \hyperlink{classdev_1_1base_1_1_thread_ac93bfd511cae069840ec1a3fee205c9c}{run} (void)=0\label{classdev_1_1base_1_1_thread_ac93bfd511cae069840ec1a3fee205c9c}

\begin{DoxyCompactList}\small\item\em 线程执行函数(子类重载此函数实现线程要执行的逻辑) \end{DoxyCompactList}\item 
\hypertarget{classdev_1_1base_1_1_thread_abdbd085206335beee2b372558a158d4d}{}void \hyperlink{classdev_1_1base_1_1_thread_abdbd085206335beee2b372558a158d4d}{exit} (void $\ast$retval=N\+U\+L\+L)\label{classdev_1_1base_1_1_thread_abdbd085206335beee2b372558a158d4d}

\begin{DoxyCompactList}\small\item\em 线程退出自动调用 \end{DoxyCompactList}\item 
\hypertarget{classdev_1_1base_1_1_thread_ab982afa8abe62f1883fbd199c6f6ac2c}{}void \hyperlink{classdev_1_1base_1_1_thread_ab982afa8abe62f1883fbd199c6f6ac2c}{join} (void)\label{classdev_1_1base_1_1_thread_ab982afa8abe62f1883fbd199c6f6ac2c}

\begin{DoxyCompactList}\small\item\em 等待线程退出 \end{DoxyCompactList}\item 
\hypertarget{classdev_1_1base_1_1_thread_a99f54dff9a8f27e67ced7476908e5498}{}id \hyperlink{classdev_1_1base_1_1_thread_a99f54dff9a8f27e67ced7476908e5498}{get\+Tid} (void) const \label{classdev_1_1base_1_1_thread_a99f54dff9a8f27e67ced7476908e5498}

\begin{DoxyCompactList}\small\item\em 获取这个线程的\+I\+D \end{DoxyCompactList}\item 
\hypertarget{classdev_1_1base_1_1_thread_a12fcc8a1be64aab3747ced6532a19cc3}{}Status \hyperlink{classdev_1_1base_1_1_thread_a12fcc8a1be64aab3747ced6532a19cc3}{get\+Status} (void) const \label{classdev_1_1base_1_1_thread_a12fcc8a1be64aab3747ced6532a19cc3}

\begin{DoxyCompactList}\small\item\em 获取线程状态 \end{DoxyCompactList}\item 
void \hyperlink{classdev_1_1base_1_1_thread_a6131865d8fb573338608d6644a5dc8ee}{set\+Status} (Status status)
\begin{DoxyCompactList}\small\item\em 设置线程状态 \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classdev_1_1base_1_1_thread_a8c9a6787ece1b03536a2762920075500}{}static id \hyperlink{classdev_1_1base_1_1_thread_a8c9a6787ece1b03536a2762920075500}{current\+Tid} (void)\label{classdev_1_1base_1_1_thread_a8c9a6787ece1b03536a2762920075500}

\begin{DoxyCompactList}\small\item\em 获取当前执行线程的\+I\+D \end{DoxyCompactList}\item 
static void \hyperlink{classdev_1_1base_1_1_thread_a10a9bbb6c05e52f32fcfe7138198c80a}{sleep} (int ms)
\begin{DoxyCompactList}\small\item\em 线程休眠 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
线程类 

\subsection{Member Function Documentation}
\hypertarget{classdev_1_1base_1_1_thread_a6131865d8fb573338608d6644a5dc8ee}{}\index{dev\+::base\+::\+Thread@{dev\+::base\+::\+Thread}!set\+Status@{set\+Status}}
\index{set\+Status@{set\+Status}!dev\+::base\+::\+Thread@{dev\+::base\+::\+Thread}}
\subsubsection[{set\+Status(\+Status status)}]{\setlength{\rightskip}{0pt plus 5cm}void Thread\+::set\+Status (
\begin{DoxyParamCaption}
\item[{Status}]{status}
\end{DoxyParamCaption}
)}\label{classdev_1_1base_1_1_thread_a6131865d8fb573338608d6644a5dc8ee}


设置线程状态 


\begin{DoxyParams}{Parameters}
{\em status} & 线程当前状态 \\
\hline
\end{DoxyParams}
\hypertarget{classdev_1_1base_1_1_thread_a10a9bbb6c05e52f32fcfe7138198c80a}{}\index{dev\+::base\+::\+Thread@{dev\+::base\+::\+Thread}!sleep@{sleep}}
\index{sleep@{sleep}!dev\+::base\+::\+Thread@{dev\+::base\+::\+Thread}}
\subsubsection[{sleep(int ms)}]{\setlength{\rightskip}{0pt plus 5cm}void Thread\+::sleep (
\begin{DoxyParamCaption}
\item[{int}]{ms}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}\label{classdev_1_1base_1_1_thread_a10a9bbb6c05e52f32fcfe7138198c80a}


线程休眠 


\begin{DoxyParams}{Parameters}
{\em ms} & 休眠时间(毫秒) \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
dev/dev/base/Thread.\+hpp\item 
dev/src/base/Thread.\+cpp\end{DoxyCompactItemize}
